%  load hedonic data
clear
load 'hed_data_log.raw'
v_crime = hed_data_log(:,1);
hv_crime_sq = hed_data_log(:,2);
logp  = hed_data_log(:,3);
hed_m  = hed_data_log(:,4);
year = hed_data_log(:,5);
tract = hed_data_log(:,6);
X = hed_data_log(:,7:end);
clear hed_data_log
save hed_data_log


%  load transition prob data
clear 
load 'tprob_data.raw'
tprob_m = tprob_data(:,1);
v_crime = tprob_data(:,2);
Lv_crime = tprob_data(:,3);
tprob_t = tprob_data(:,4);
Lpm10 = tprob_data(:,5);
tempind = (tprob_t<19);
tempind2 = (tprob_t>2);
LLv_crime = 999+ 0*v_crime;
LLv_crime(tempind2) = Lv_crime(tempind);
clear tprob_data tempind tempind2
save tprob_data


%  load consump data
clear 
load 'consump_data.raw'
a = consump_data(:,2);
index = find(a<prctile(a,98) & a>prctile(a,2));
con_m = consump_data(index,1);
a = consump_data(index,2);
t = consump_data(index,3);
race = consump_data(index,4); race = race - min(race) + 1;
inc = consump_data(index,5);
price = consump_data(index,6);
clear consump_data
save consump_data

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
load 'murder_data.raw'
murder = murder_data(:,1);
year = murder_data(:,2);
clear murder_data
save murder_data


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear 
load 'tsp_data.raw'
tsp = tsp_data(:,1);
L_tsp = tsp_data(:,2);
year = tsp_data(:,3);
clear tsp_data
save tsp_data

clear
load 'tsp_data_rob.raw'
tsp = tsp_data_rob(:,1);
L_tsp = tsp_data_rob(:,2);
LL_tsp = tsp_data_rob(:,3);
year = tsp_data_rob(:,4);
clear tsp_data_rob
save tsp_data_rob